<template>
	<!-- 顶部模块：导航 nav -->
	<ContestHeader v-if="contest" :contest="contest"></ContestHeader>

	<!-- 中间板块： tab container -->
	<div id="container" v-if="contest">
		<RouterView />
	</div>

	<!-- 底部模块 -->
	<Footer></Footer>
</template>


<script setup>
import { RouterView, useRoute } from 'vue-router'
import { ref, provide } from 'vue';
import ContestHeader from '@/components/ContestHeader.vue'
import Footer from '@/components/Footer.vue'
import { ContestService, ContestStatusService } from '@/common/common.object'

const route = useRoute();

const CONTEST_ID = route.params.id || route.params.contestId;

const contest = ref(null);
provide('contest', contest)

ContestService.get(CONTEST_ID).then(result => {
	contest.value = ContestStatusService.process(result);
});
</script>


<style scoped></style>
